package com.android.kuai.zhuan.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.android.kuai.zhuan.utils.AlarmManagerUtils;

public class AlarmReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        //高版本重复设置闹钟达到低版本中setRepeating相同效果
        AlarmManagerUtils.getInstance(context).getUpAlarmManagerWorkOnReceiver();
        //
        String extra = intent.getStringExtra("msg");
        Log.i("leihuiming", "extra = " + extra);

        Intent daemonIntent = new Intent();
        daemonIntent.setClassName("com.android.kuai.zhuan", "com.android.kuai.zhuan.service.MainService");
        daemonIntent.putExtra("command", "daemon");
        context.startService(daemonIntent);
    }
}
